<?php 
// check if there's a model specific max rating specified
if(Configure::read('Rating.maxStars'))
{
	// get default
	$maxStars = Configure::read('Rating.default');
}

?>

<?php  
// when no controls are needed, only rating need to be shown
if(isset($settings['control']) && $settings['control'] == 'disable')
{
?>
	<ul class="star-rating">
	<li class="current-rating" style="width:<?php echo $settings['width'];?>px;"> Currently <?php echo $settings['score'];?>/<?php echo $maxStars;?> Stars.</li>
	<?php  foreach(range(1, $maxStars) as $tmpRate) { ?>
	<li><?php echo $tmpRate; ?></li>
	<?php  } ?>
	</ul>
<?php 
// rateable stars with controls
} else {
?>
	<ul class="star-rating" id="<?php echo $settings['type'].'-'.$settings['item_id'];?>">
	<li class="current-rating" style="width:<?php echo $settings['width'];?>px;"> Currently <?php echo $settings['score'];?>/<?php echo $maxStars;?> Stars.</li>

	<?php  foreach(range(1, $maxStars) as $tmpRate) { ?>
	<li class="ratingControls"><a href='#' onclick="rate(<?php echo $tmpRate;?>, <?php echo $settings['item_id'];?>, '<?php echo $settings['type'];?>', '<?php echo $settings['jsCallback'];?>' );" title='<?php echo $tmpRate;?> star out of <?php echo $maxStars;?>' class='star-<?php echo $tmpRate;?>'> <?php echo $tmpRate;?> </a></li>

	<?php  } ?>
	</ul>
	
	<ul class="star-rating star-rating-disabled" id="<?php echo $settings['type'].'-'.$settings['item_id'];?>-ratingWithoutControls" style="display:none;">
	<li class="current-rating" style="width:<?php echo $settings['width'];?>px;"> Currently <?php echo $settings['score'];?>/<?php echo $maxStars;?> Stars.</li>
	<?php  foreach(range(1, $maxStars) as $tmpRate) { ?>
	<li class="ratingControls"><?php echo $tmpRate;?></li>
	<?php  } ?>
	</ul>
	
<?php  } ?>